#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;

vector<int> partitionLabels(string s) {
    
    map<char, int> mp;
    for (unsigned int i = 0; i < s.size(); i++) {
        if (mp.count(s[i]) == 0) {
            mp.insert(pair<char, int>(s[i], i));
        } else {
            map<char, int>::iterator it = mp.find(s[i]);
            if (it != mp.end()) {
                it->second = i;
            }
        }
    }

    // map<char, int>::iterator iter;
    // for(iter = mp.begin(); iter != mp.end(); iter++)
    // {
    //     cout<<iter->first<<"  "<<iter->second<<" "<<endl;
    // }
    //再次遍历s，如果s[i]的最远出现位置等于当前的i,这就是分割位置
    vector<int> res;
    int last = -1;
    int max = 0;
    for (unsigned int i = 0; i < s.size(); i++) {
        map<char, int>::iterator it = mp.find(s[i]);
        if (it->second > max) 
            max = it->second;

        if (i == max) {
            res.push_back(i - last);
            last = i;
        }
    }
    return res;

}

int main() {
    string s;
    cin >> s;
    vector<int> res = partitionLabels(s);
    cout << res[0] ;
    for (unsigned int i = 1; i < res.size(); i++) {
        cout << " " << res[i];
    }
    return 0;
}